package VarParameter;

public class VarParameterExercising {
    public static void main(String[] args) {
        Method m = new Method();
        m.getSum("lfm", 20, 20 ,30, 49, 2399, 22);
    }
}


class Method {
    void getSum(String s, int... nums) {
        System.out.println(s);
        int res = 0;
        for (int num : nums) {
            res += num;
        }
        System.out.println("名字是" + s + "有" + nums.length + "门科目 " + "总分为" + res);
    }
}